import request from '@/utlis/request'
/**
 * 获取文章详情
 * @param {*} id 文章id
 * @returns
 */
export const reqGetArticle = (id) => request({
  url: '/v1_0/articles/' + id
})
/**
 * 关注用户
 * @param {*} target 用户id
 * @returns
 */
export const reqFollowAuthor = (target) => request({
  method: 'post',
  url: '/v1_0/user/followings',
  data: { target }
})
/**
 * 取关用户
 * @param {*} target 用户id
 * @returns
 */
export const reqUnFollowAuthor = (target) => request({
  method: 'delete',
  url: '/v1_0/user/followings/' + target
})
/**
 * 点赞文章
 * @param {*} target 文章id
 * @returns
 */
export const reqLikeArticle = (target) => request({
  method: 'post',
  url: '/v1_0/article/likings',
  data: { target }
})
/**
 * 取消点赞文章
 * @param {*} target 文章id
 * @returns
 */
export const reqUnLikeArticle = (target) => request({
  method: 'delete',
  url: '/v1_0/article/likings/' + target
})
/**
 * 不喜欢文章
 * @param {*} target 文章id
 * @returns
 */
export const reqAddDisLike = (target) => request({
  method: 'post',
  url: '/v1_0/article/dislikes',
  data: { target }
})
/**
 * 取消不喜欢文章
 * @param {*} target 文章id
 * @returns
 */
export const reqDelDisLike = (target) => request({
  method: 'delete',
  url: '/v1_0/article/dislikes/' + target
})
